Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tr1/lara/cheat: reset meshes in fly cheat #2571

Merged
merged 1 commit into from
Mar 2, 2025

Conversation

lahm86
Copy link
Collaborator

@lahm86 lahm86 commented Mar 1, 2025

Resolves #2565.
Resolves #2572.

Checklist

  • I have read the coding conventions
  • I have added a changelog entry about what my pull request accomplishes, or it is an internal change
  • I have added a readme entry about my new feature or OG bug fix, or it is a different change

Description

This restores Lara's meshes if she is resurrected with the fly cheat. The only scenario we can't efficiently cover is the following:

  • draw magnums or uzis
  • draw shotgun
  • die and resurrect

In this case the holstered guns will be pistols because we don't store the last holstered gun type, and looking it up would involve a lot of mesh comparison which I don't feel is worth it, plus for things like the T-Rex and Midas deaths, the information is lost anyway. If the last gun is not the shotgun, the correct holster meshes will be restored normally.

Otherwise, other scenarios should hopefully work as expected 🤞 Worth checking #2461 too.

@lahm86 lahm86 added TRX bug A bug with TRX TR1 labels Mar 1, 2025
@lahm86 lahm86 self-assigned this Mar 1, 2025
@lahm86 lahm86 requested review from a team as code owners March 1, 2025 12:53
@lahm86 lahm86 requested review from rr-, walkawayy and aredfan and removed request for a team March 1, 2025 12:53
Copy link

github-actions bot commented Mar 1, 2025

@aredfan
Copy link
Collaborator

aredfan commented Mar 1, 2025

Everything looks good, thank you. 👍

I did find a bug with Lara holding a shotgun in one hand, but I don't think it's related to this PR as it's already on develop, will raise an issue shortly.

@lahm86 lahm86 force-pushed the issue-2565-cheat-meshes branch from d6b2cf3 to 8d20aab Compare March 1, 2025 15:01
@lahm86 lahm86 changed the title tr1/lara/cheat: reset meshes on resurrection tr1/lara/cheat: reset meshes in fly cheat Mar 1, 2025
@lahm86
Copy link
Collaborator Author

lahm86 commented Mar 1, 2025

Everything looks good, thank you. 👍

I did find a bug with Lara holding a shotgun in one hand, but I don't think it's related to this PR as it's already on develop, will raise an issue shortly.

Thanks, should be addressed. Easiest just to do it here as it's all so related.

@lahm86 lahm86 requested a review from aredfan March 1, 2025 15:03
Copy link
Collaborator

@aredfan aredfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, should be addressed. Easiest just to do it here as it's all so related.

Your fix did the trick. Thank you. 😄

Gun_SetLaraHolsterLMesh(holsters_gun_type);
Gun_SetLaraHolsterRMesh(holsters_gun_type);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic is duplicated from somewhere isn't it? I think Lara_InitialiseMeshes. Any chance we can avoid duplication?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, Lara_InitialiseMeshes uses RESUME_INFO though, so doesn't take into account guns she currently has, plus it results in the original bug with #2461. Maybe we could change the signature though.

Copy link
Collaborator

@rr- rr- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but it'd be nice to merge the common parts, possibly through a new, third function.

@lahm86
Copy link
Collaborator Author

lahm86 commented Mar 1, 2025

LGTM but it'd be nice to merge the common parts, possibly through a new, third function.

WDYT about getting rid of resume->flags.costume in favour of just testing if it's currently the gym level? I think this would make it easier to merge the functions as we don't really need RESUME_INFO; Lara's inventory is already initialised on the only other call to Savegame_ApplyLogicToCurrentInfo.

@rr-
Copy link
Collaborator

rr- commented Mar 1, 2025

LGTM but it'd be nice to merge the common parts, possibly through a new, third function.

WDYT about getting rid of resume->flags.costume in favour of just testing if it's currently the gym level? I think this would make it easier to merge the functions as we don't really need RESUME_INFO; Lara's inventory is already initialised on the only other call to Savegame_ApplyLogicToCurrentInfo.

This will make adding a potential option to change costumes at runtime more difficult; can we use a hybrid solution?

@lahm86
Copy link
Collaborator Author

lahm86 commented Mar 1, 2025

Sure, I'll take another look tomorrow 👍

@lahm86 lahm86 force-pushed the issue-2565-cheat-meshes branch from 8d20aab to 481597f Compare March 2, 2025 09:32
@lahm86
Copy link
Collaborator Author

lahm86 commented Mar 2, 2025

Hybrid approach is now in place, so we just have a single function. This will need testing again I'm afraid, especially going between levels, and in Natla's Mines with gun loss. Also, going from the gym to a game level, or back to the gym via a save or otherwise, to ensure the costume swap behaves normally.

@lahm86 lahm86 requested review from rr- and aredfan March 2, 2025 09:34
@aredfan
Copy link
Collaborator

aredfan commented Mar 2, 2025

Hybrid approach is now in place, so we just have a single function. This will need testing again I'm afraid, especially going between levels, and in Natla's Mines with gun loss. Also, going from the gym to a game level, or back to the gym via a save or otherwise, to ensure the costume swap behaves normally.

These scenarios and the linked issues LGTM.

The only issue I found is that Lara's holstered weapons revert to pistols between levels if she has magnums/uzis holstered and the shotgun equipped.

@lahm86 lahm86 force-pushed the issue-2565-cheat-meshes branch from 481597f to b4428f6 Compare March 2, 2025 12:21
@lahm86
Copy link
Collaborator Author

lahm86 commented Mar 2, 2025

Thanks, @aredfan. Hopefully that's fixed now.

Copy link
Collaborator

@aredfan aredfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @aredfan. Hopefully that's fixed now.

Can confirm, thank you. 👍

@lahm86 lahm86 merged commit 07e469b into LostArtefacts:develop Mar 2, 2025
8 checks passed
@lahm86 lahm86 deleted the issue-2565-cheat-meshes branch March 2, 2025 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TR1 TRX bug A bug with TRX
Projects
Status: Done
4 participants